Embedded systems often perform dedicated functions within larger mechanical or electrical systems, such as cars, telephones, modems, robots, appliances, toys, security systems, pacemakers, televisions, set-top boxes, digital watches, or the like. Most of these embedded systems include one or more processing devices executing embedded software—typically written in in C, C++, or the like—that can allow the embedded systems to perform the dedicated functions under real-time computing constraints, for example, by utilizing a real-time operating system, such as Nucleus real-time operating system (RTOS), or the like.
Programmers of embedded software often build their source code modularly, i.e., with a program that references or one or more different programs or libraries. These different programs or libraries are linked to the program so the program can be executed. This linking can be performed at compile time, when source code is translated into machine code, at load time, when the program is loaded into a memory device of the embedded system, or at run time, for example, dynamically by application programs.
There are a couple of different types of linking—static linking and dynamic linking—which can collect and combine multiple object files from the different programs and or libraries in order to create a single executable. Static linking, which is often performed by a compiler, copies library functions or routines referenced by the program into a monolithic executable software image. Dynamic linking can occur when an executable version of the program is loaded in a common memory with the programs or libraries to be linked and the executable version of the program is run by the embedded system. Since static linking links the program prior to runtime, a monolithic executable software image generated by static linking can usually be executed more quickly at runtime than a dynamically linked program and is usually more portable. The monolithic executable software image, however, often consumes more memory resources than its dynamically-linked counterpart, as the static linking scheme does not allow sharing of the different programs and libraries in the embedded system.
Many embedded systems, in an attempt to reduce writable memory consumption, have their processing devices execute this embedded software directly from long-term memory, often called execution-in-place (XIP), rather than copying it into a random access memory (RAM). Since dynamic linking of embedded software requires write operations during runtime operation, execution-in-place with dynamic-linking stores the executable images in writable memory, such as the random access memory. Once the dynamic-linking has been performed, however, the linked executable images, for the most part, remain static, which consumes the writable memory with a program having a large portion needing no additional writing during runtime.